﻿<%@ Page Language="C#" AutoEventWireup="true"
    Inherits="DeliverGoodsManagement_SettlementDetails" Codebehind="SettlementDetails.aspx.cs" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>
    <style type="text/css">
.hidden{visibility:hidden }
body {font-size:12px;margin:0;padding:0;}
a:visited{text-decoration:none;color:slategray;}
a:hover{text-decoration:underline;color:slategray;}
a:link{text-decoration:none;color:slategray;}
.juli {margin-top:10px;padding-left:20px;}
.tb2 {width: 1050px; background-color:#999999;}
.z1{background-color:#e7e7e7; text-align:left; line-height:20px;}
.z2{background-color:#FFFFFF; text-align:left; line-height:20px;}
.zt3 {text-align:center; font-weight:600; color:#000000;}
.zt4 {text-align:center; color:#000000;}
.zt5 {text-align:left; font-weight:600;}
.zt7 {text-align:right; color:#000000;}
.zt8 {text-align:right; color:#000000;}
.tb {width: 90%; background-color:#999999;}
a.lj {font-size:12px; color:#ff9900; text-decoration:underline;}
a.lj:link {font-size:12px; color:#ff9900; text-decoration:underline;}
a.lj:visited {font-size:12px; color:#ff9900; text-decoration:underline;}
a.lj:hover {color:#ff3300;}
a.lj:active {color:#ff3300;}
.menu_bg { background-color:#fef3bb; padding-left:20px;padding-top:6px; padding-bottom:6px;border-bottom:#cf994b 1px solid;}
.menu_bg1 { background-color:#f5f5f5; padding-left:20px;padding-top:6px; padding-bottom:6px;border-bottom:#cccccc 1px solid;border-top:#cccccc 1px solid;clear:left;}
.input_button {width:52px;height:23px;border:none;cursor:pointer; background:#ffffff url(../Include/Images/bt.gif) no-repeat;}
h2 {padding-left:20px;padding-top:10px;margin:0; background: url(../Include/Images/menu_title.gif) repeat-x;height:21px;font-size:14px; font-weight:600;}
.bk_left {border-bottom:#999999 1px solid;border-right:#999999 1px solid;border-left:#999999 1px solid;border-top:#999999 0px solid;}
.bk_middle {border-bottom:#999999 1px solid;border-right:#999999 1px solid;border-left:#999999 0px solid;border-top:#999999 0px solid;}
.kuandu {width:30px; text-align:right;}
.kuandu1 {width:60px; text-align:right;}
.kuandu2 {width:100px; text-align:right;}
.kuandu3 {width:124px; text-align:right;}
.menu_bg3 {background-color:#cccccc;margin:10px 0 10px 0;padding-top:5px;padding-bottom:5px;padding-left:20px;border:#CCCCCC 0px solid; font-size:12px; height:22px;}
.jiacu {float:left; font-weight:bold;padding-top:5px;padding-bottom:5px;}
.input_button3 {width:95px;height:23px;border:none;background:#ffffff url(../Include/Images/bt2.gif) no-repeat;}
</style>

    <script type="text/javascript" src="../Include/Js/SocanCode.js"></script>

    <script type="text/javascript" src="../Include/Js/PopupCalendar.js"></script>

    <script type="text/javascript" src="../Include/Js/calendar.js"></script>

    <script type="text/javascript">
        function OpenWindowToAddOrder()
        {
            
            var customerId = document.getElementById("hidCustomerId").value;

            var url = "getorder.aspx?code="+customerId;
            window.open(url,"window",'toolbar=no,menubar=no,location=no,center=yes,dialogHeight:500px,dialogWidth:600px,help:0,resizable:0,scrollbar=0');
        }
        function OpenOrderWindow(link)
        {
            var strOrderType = link.title.substring(0,3);
            if(strOrderType=="THD")
            {
                var url = "../Order/ReturnDocEdit.aspx?code=" + link.title;
                window.open(url);
            }
            else
            {
                var url = "../Order/OrderDetail.aspx?code=" + link.title;
                window.open(url);
            }
            

        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <div align="Justify">
            <h2>
                结算单明细</h2>
            <div class="menu_bg">
                <asp:Button ID="btnAudit" CssClass="input_button" runat="server" Text="核准" OnClick="btnAudit_Click" />
                <asp:Button ID="btnDelete" CssClass="input_button" runat="server" Text="删除" OnClick="btnDelete_Click" />
                <asp:Button ID="btnSave" CssClass="input_button" runat="server" Text="保存" OnClick="btnSave_Click" />
                <asp:Button ID="btnCancel" CssClass="input_button" runat="server" Text="取消" OnClick="btnCancel_Click" />
                <asp:Button ID="btnReturn" runat="server" Text="返回" CssClass="input_button" OnClick="btnReturn_Click" />
                <input id="hidCustomerId" runat="server" type="hidden" /></div>
            <div class="juli">
                <asp:DataList ID="dlistPayDoc" runat="server" OnItemDataBound="dlistPayDoc_ItemDataBound">
                    <ItemTemplate>
                        <table style="background-color: #999999;" border="0" cellspacing="1" cellpadding="0">
                            <tr class="z2">
                                <td class="zt5" width="120">
                                    编号：

                                </td>
                                <td width="200">
                                    <%# Eval("PD_ID")%>
                                </td>
                                <td class="zt5" width="120">
                                    会员名称：

                                </td>
                                <td width="200">
                                    <%# Eval("CustomerName")%>
                                </td>
                            </tr>
                            <tr class="z2">
                                <td class="zt5">
                                    结算类型：

                                </td>
                                <td>
                                    <%# Convert.ToString(Eval("PD_CLEARTYPE"))=="001"?"应收款":"预收款"%>
                                </td>
                                <td class="zt5">
                                    结算金额：

                                </td>
                                <td>
                                    <asp:TextBox ID="txtSettleAmount" runat="server" Text='<%# String.Format("{0:0.00}",Eval("PD_CAMT"))%>' Enabled="false"></asp:TextBox>
                                </td>
                            </tr>
                            <tr class="z2">
                                <td class="zt5">
                                    支付金额：

                                </td>
                                <td>
                                    <asp:TextBox ID="txtPayAmount" runat="server" Text='<%# String.Format("{0:0.00}",Eval("PD_PAMT"))%>' Enabled="false"></asp:TextBox>
                                </td>
                                <td class="zt5">
                                    结余金额：

                                </td>
                                <td>
                                    <asp:TextBox ID="txtSubAmount" runat="server" Text='<%# String.Format("{0:0.00}",Eval("PD_SUBAMT"))%>' Enabled="false"></asp:TextBox>
                                </td>
                            </tr>
                            <tr class="z2">
                                <td class="zt5">
                                    制单人：
                                </td>
                                <td>
                                    <%# Eval("CreaterName")%>
                                </td>
                                <td class="zt5">
                                    制单日期：

                                </td>
                                <td>
                                    <%# Eval("PD_CREATEDATE")%>
                                </td>
                            </tr>
                            <tr class="z2">
                                <td class="zt5">
                                    核准：

                                </td>
                                <td>
                                    <asp:CheckBox ID="CheckBox3" runat="server" Checked=' <%# Convert.ToString(Eval("PD_CHECK"))=="1"?true:false %>'
                                        Enabled="false" />
                                </td>
                                <td class="zt5">
                                    核准人：
                                </td>
                                <td>
                                    <%# Eval("CheckerName")%>
                                </td>
                            </tr>
                            <tr class="z2">
                                <td class="zt5">
                                    核准日期：

                                </td>
                                <td>
                                    <%# Eval("PD_CHECKDATE")%>
                                </td>
                                <td class="zt5">
                                    担保交易
                                </td>
                                <td>
                                    <asp:CheckBox ID="CheckBox1" runat="server" Checked=' <%# Convert.ToString(Eval("PD_SECDEAL"))=="1"?true:false %>' Enabled="false" />
                                </td>
                            </tr>
                            <tr class="z2">
                                <td class="zt5">
                                    原单据编号：
                                </td>
                                <td>
                                    <%# Eval("PD_AID")%>
                                </td>
                                <td class="zt5">
                                    备注：

                                </td>
                                <td>
                                    <asp:TextBox ID="txtNotes" runat="server" Text='<%# Eval("PD_NOTE")%>'></asp:TextBox>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </asp:DataList></div>
            <div class="menu_bg3">
                <span class="jiacu">订单明细</span>&nbsp;&nbsp;<input id="btnGetOrder" class="input_button3"
                    type="button" value="添加结算单明细" runat="server" visible="false" onclick="OpenWindowToAddOrder()" /></div>
            <div class="juli">
                <asp:DataList ID="dlistPayDocDetail" runat="server" OnItemCommand="dlistPayDocDetail_ItemCommand"
                    OnItemDataBound="dlistPayDocDetail_ItemDataBound" CellPadding="0">
                    <ItemTemplate>
                        <table width="1050" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td width="60" align="center" class="bk_left">
                                    <asp:Button ID="btnDelete" runat="server" CssClass="input_button" Text="删除" CommandName="DeleteItem" />
                                </td>
                                <td width="70" align="center" class="bk_middle">
                                    <%# Convert.ToString(Eval("PDD_DOCTYPE"))=="001"?"订单":"退货单"%>
                                </td>
                                <td width="140" align="center" class="bk_middle">
                                    <a href="#" class="lj" onclick="OpenOrderWindow(this)" title="<%# Eval("PDD_DOCID")%>"><%# Eval("PDD_DOCID")%></a>
                                </td>
                                <td width="140" align="center" class="bk_middle">
                                    <%# Eval("PDD_DOCDATE")%>
                                </td>
                                <td width="100" align="right" class="bk_middle">
                                    <%--<asp:TextBox ID="txtTotal" runat="server" Text='<%# Eval("PDD_TAMT")%>'></asp:TextBox>--%>
                                    <asp:Label ID="txtTotal" runat="server" Text='<%# String.Format("{0:0.00}",Eval("PDD_TAMT"))%>'></asp:Label>
                                </td>
                                <td width="100" align="right" class="bk_middle">
                                    <%--<asp:TextBox ID="txtSettleAmount" runat="server" Text='<%# Eval("PDD_CLEAREDAMT")%>'></asp:TextBox>--%>
                                    <asp:Label ID="txtSettleAmount" runat="server" Text='<%# String.Format("{0:0.00}",Eval("PDD_CLEAREDAMT"))%>'></asp:Label>
                                </td>
                                <td width="100" align="center" class="bk_middle">
                                    <asp:TextBox ID="txtAmount" CssClass="kuandu1" runat="server" Text='<%# String.Format("{0:0.00}",Eval("PDD_AMT"))%>'></asp:TextBox>
                                    <asp:Button ID="btnUpdateClearAmount" runat="server" Text="" CssClass="hidden" CommandName="upt" />
                                </td>
                                <td width="100" align="center" class="bk_middle">
                                    <asp:TextBox ID="txtSubAmount" CssClass="kuandu1" runat="server" Text='<%# String.Format("{0:0.00}",Eval("PDD_SUBAMT"))%>' Enabled="False"></asp:TextBox>
                                </td>
                                <td align="center" class="bk_middle">
                                    <asp:TextBox ID="txtNotes" runat="server" Width="200" Text='<%# Eval("PDD_NOTE")%>'></asp:TextBox>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                    <HeaderTemplate>
                        <table class="tb2" border="0" cellspacing="1" cellpadding="0">
                            <tr class="z1">
                                <td class="zt3" width="60">
                                    删除
                                </td>
                                <td class="zt3" width="70">
                                    单据性质
                                </td>
                                <td class="zt3" width="140">
                                    单据编号
                                </td>
                                <td class="zt3" width="140">
                                    单据日期
                                </td>
                                <td class="zt3" width="100">
                                    总金额

                                </td>
                                <td class="zt3" width="100">
                                    已结算金额

                                </td>
                                <td class="zt3" width="100">
                                    本次结算金额
                                </td>
                                <td class="zt3" width="100">
                                    余额
                                </td>
                                <td class="zt3">
                                    备注
                                </td>
                            </tr>
                        </table>
                    </HeaderTemplate>
                </asp:DataList></div>
            <br />
            <div class="menu_bg3">
                <span class="jiacu">支付明细</span>&nbsp;&nbsp;<asp:Button ID="btnAddPayDocPayDetail"
                    CssClass="input_button3" runat="server" Text="添加支付明细" OnClick="btnAddPayDocPayDetail_Click"
                    Visible="false" /></div>
            <div class="juli">
                <asp:DataList ID="dlistPayDocPayDetail" runat="server" OnItemDataBound="dlistPayDocPayDetail_ItemDataBound"
                    OnItemCommand="dlistPayDocPayDetail_ItemCommand" CellPadding="0">
                    <ItemTemplate>
                        <table width="1050" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td width="60" align="center" class="bk_left">
                                    <asp:Button ID="btnDelete" runat="server" CssClass="input_button" Text="删除" CommandName="del" />
                                </td>
                                <td width="140" align="center" class="bk_middle">
                                    <asp:DropDownList ID="dropPayType" runat="server">
                                    </asp:DropDownList>
                                </td>
                                <td width="100" align="center" class="bk_middle">
                                    <asp:TextBox ID="txtPayAmount" CssClass="kuandu1" runat="server" Text='<%# String.Format("{0:0.00}",Eval("PDPD_PAYAMT"))%>'></asp:TextBox>
                                    <asp:Button ID="btnUpdatePayAmount" runat="server" Text="" CssClass="hidden" CommandName="upt" />
                                </td>
                                <%--<td width="120" align="center" class="bk_middle">
                                    <asp:TextBox ID="txtPayDate" CssClass="kuandu2" runat="server" Text='<%# Convert.ToDateTime(Eval("PDPD_PAYDATE")).ToShortDateString()%>'
                                        OnClick="setday(this)"></asp:TextBox>
                                </td>--%>
                                <td width="134" align="center" class="bk_middle">
                                    <asp:TextBox ID="txtDealId" CssClass="kuandu3" runat="server" Text='<%# Eval("PDPD_DEALID")%>'></asp:TextBox>
                                </td>
                                <td width="120" align="center" class="bk_middle">
                                    <asp:TextBox ID="txtDealDate" CssClass="kuandu2" runat="server" Text='<%# Convert.ToDateTime(Eval("PDPD_DEALDATE")).ToShortDateString()%>'
                                        OnClick="setday(this)"></asp:TextBox>
                                </td>
                                <td width="134" align="center" class="bk_middle">
                                    <asp:TextBox ID="txtAccount" CssClass="kuandu3" runat="server" Text='<%# Eval("PDPD_ACCOUNT")%>'></asp:TextBox>
                                </td>
                                <td align="center" class="bk_middle">
                                    <asp:TextBox ID="txtNotes" runat="server" Width="310" Text='<%# Eval("PDPD_NOTE")%>'></asp:TextBox>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                    <HeaderTemplate>
                        <table class="tb2" border="0" cellspacing="1" cellpadding="0">
                            <tr class="z1">
                                <td class="zt3" width="60">
                                    删除
                                </td>
                                <td class="zt3" width="140">
                                    支付方式
                                </td>
                                <td class="zt3" width="100">
                                    支付金额
                                </td>
                                <%--<td class="zt3" width="120">
                                    支付日期
                                </td>--%>
                                <td class="zt3" width="134">
                                    交易号

                                </td>
                                <td class="zt3" width="120">
                                    交易日期
                                </td>
                                <td class="zt3" width="134">
                                    帐号
                                </td>
                                <td class="zt3">
                                    备注
                                </td>
                            </tr>
                        </table>
                    </HeaderTemplate>
                </asp:DataList></div>
        </div>
    </form>
</body>
</html>
